#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include "ConfProto.h"
#include "tblutil.h"
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\AAT.h>

const char*AATName = "AAT.dat";

static AAT_REC srAATRec;

static int recordNum;
int	inLoadAATRec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(AAT_FILENAME, SIZE_AAT_REC, inRecNumber, (char *) &srAATRec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetAATRec(void)
{
	return &srAATRec;

}

int	inSaveAATRec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(AAT_FILENAME, SIZE_AAT_REC, inRecNumber, (char *) &srAATRec);

	return inRet;
}

int	inGetAATRecNumber (void)
{
	return recordNum;
}

int	inUpdateAATRec (void)
{
	int inRet;

	inRet = inSaveConfRec(AAT_FILENAME, SIZE_AAT_REC, recordNum, (char *) &srAATRec);

	return inRet;
}

void	vdResetAATRec (void)
{
	memset((void*)&srAATRec, 0, REC_SIZEOF(srAATRec));
}

char* szGetAutoAnsInit(void)
{
	return srAATRec.szAutoAnsInit;
}

void vdSetAutoAnsInit(const char* szAutoAnsInit)
{
	strNumCopy(srAATRec.szAutoAnsInit, szAutoAnsInit, sizeof(((AAT_REC*)NULL)->szAutoAnsInit)-1);
}

short shGetAutoAnsBaudRate(void)
{
	return srAATRec.shAutoAnsBaudRate;
}

void vdSetAutoAnsBaudRate(short shAutoAnsBaudRate)
{
	srAATRec.shAutoAnsBaudRate = shAutoAnsBaudRate;
}

short shGetAutoAnsFormat(void)
{
	return srAATRec.shAutoAnsFormat;
}

void vdSetAutoAnsFormat(short shAutoAnsFormat)
{
	srAATRec.shAutoAnsFormat = shAutoAnsFormat;
}

